package com.woniuxy.education.controller;

import com.woniuxy.education.entity.Allschool;
import com.woniuxy.education.entity.GradeDean;
import com.woniuxy.education.entity.School_Contrast;
import com.woniuxy.education.service.SchoolMasterService;
import com.woniuxy.education.service.SchoolService;
import com.woniuxy.education.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/schoolmaster")
public class SchoolMasterController extends ExceptionCenter{


    @Autowired
    SchoolMasterService schoolMasterService;

    @RequestMapping("/schoolcontrast")
    public List<School_Contrast> findSchoolContrast(int userid){

        List<School_Contrast> schoolContrasts = schoolMasterService.findSchoolContrast(userid);

        return schoolContrasts;
    }

    @RequestMapping("/gradeDean")
    public List<GradeDean> findGradeDean() {

        List<GradeDean> gradeDeans = schoolMasterService.findGradeDean();

        return gradeDeans;
    }

    @RequestMapping("/findContrast")
    public  School_Contrast findContrast(){
        School_Contrast school_contrast = schoolMasterService.findContrast();
        return school_contrast;
    }

}
